#include "toolfactory.h"
#include "tool.h"
#include "bmppenciltool.h"
#include "bmperasertool.h"
#include "bmpdroppertool.h"
#include "bmpcliprect.h"
#include "buttonsave.h"
#include "buttonload.h"
#include "bmpordercolors.h"
#include "spriteeditorbuttons.h"
#include "buttonbmpsaverect.h"

#include <string.h>
/* TODO
DONE Pencil
DONE Eraser
DONE Dropper
DONE ClipRect
DONE Save
DONE Load
Undo
Redo
DONE Prev
DONE Stop
DONE Next
DONE Play
Delete
DONE +Frame
DONE +Animation
DownClip
UpClip
UseClip
MakeClip
DONE OrderColors
*/

#define IS_IT_(tool)	\
	if(strcmp(a_name, tool::NAME) == 0)\
	{\
		return new tool(a_context);\
	}

Tool * ToolFactory::getNewTool(const char * a_name, void * a_context)
{
	IS_IT_(BMPPencilTool)
	IS_IT_(BMPEraserTool)
	IS_IT_(BMPDropperTool)
	IS_IT_(BMPClipRect)
	IS_IT_(ButtonSave)
	IS_IT_(ButtonLoad)
	IS_IT_(BMPOrderColors)
	IS_IT_(SpriteActionAddAnimation)
	IS_IT_(SpriteActionAddFrame)
	IS_IT_(SpriteActionAddCopyFrame)
	IS_IT_(SpriteActionRun)
	IS_IT_(SpriteActionNextFrame)
	IS_IT_(SpriteActionPrevFrame)
	IS_IT_(SpriteActionAddClip)
	IS_IT_(SpriteActionDeleteClip)
	IS_IT_(SpriteActionMoveClipUp)
	IS_IT_(SpriteActionMoveClipDown)
	IS_IT_(SpriteActionDeleteFrame)
	IS_IT_(SpriteActionDeleteAnimation)
	IS_IT_(SpriteActionFlipClip90)
	IS_IT_(SpriteActionFlipClip180)
	IS_IT_(SpriteActionFlipClipX)
	IS_IT_(SpriteActionFlipClipY)
	IS_IT_(SpriteActionFlipClipXY)
	IS_IT_(ButtonBMPSaveRect)
	return 0;
}
